package main

import (
	"encoding/json"
	"fmt"
	"spider/common"
	"spider/fetcher"
	"spider/models/meituan/meituanMeishiH5"
)

func main() {
	var url string
	var data string
	cookieArr:=map[string]string{
		"hk":`IJSESSIONID=krnrxojhyg5u1mla3q2hfakhj; _lxsdk_cuid=170f768f6b1c8-0d77ee74f3cebd-6a177a22-448e0-170f768f6b15b; _lxsdk=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; webp=1; ci3=1; uuid=74bba31d-8502-4fce-901d-243895502334; _hc.v=ffd573f4-9547-a837-1ec3-752c000f1fa6.1584698829; JSESSIONID=14ux46lbfirmx28s816b045d3; c_6NCia=1; ; __mta=250003129.1584699068850.1584699068850.1584699068850.1; w_addr=%E6%9C%9D%E9%98%B3%E5%8C%BA%E7%94%98%E9%9C%B2%E5%9B%AD%E5%8D%97%E9%87%8C%E4%BA%8C%E5%8C%BA(102%E5%9B%BD%E9%81%93%E5%8D%97); latlng=39.910697,116.504452,1585532440984; cityname=%E5%8C%97%E4%BA%AC; __utma=74597006.1422517486.1584698817.1584698817.1585532434.2; __utmc=74597006; __utmz=74597006.1585532434.2.2.utmcsr=sm.cn|utmccn=sm.cn|utmcmd=organic|utmctr=%E7%BE%8E%E5%9B%A2%E7%BD%91%E9%A1%B5%E7%89%88|utmcct=100001; i_extend=C_b1Gimthomepagecategory11H__a; ci=1; meishi_ci=1; cityid=1; p_token=IplXXLaGAatRU7wP5Z9w0etMSdUAAAAAQQoAAJtRnplGfuryswMbk4X1ow9Ihk0iz5gLak89Honu6L9nmcoKF1wsMD0Y70TmpnqCsw; utm_source=0; wx_channel_id=0; channelType={%22default%22:%220%22}; w_visitid=fc6b4769-2847-4093-a1dd-1805569d493d; wm_order_channel=default; w_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; _lx_utm=utm_source%3Dsm.cn%26utm_medium%3Dorganic%26utm_term%3D%25E7%25BE%258E%25E5%259B%25A2%25E5%25A4%2596%25E5%258D%2596; service-off=0; iuuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; token=vLINH8qXPw_1k9jR3NkjRa3B2Z8AAAAAQQoAAGcxw4QsmAgmFDYEWg7Wzvidj-xnMpwybqGpWeVbxxeAZNlbf1obxYjEJCoutIP2jQ; mt_c_token=vLINH8qXPw_1k9jR3NkjRa3B2Z8AAAAAQQoAAGcxw4QsmAgmFDYEWg7Wzvidj-xnMpwybqGpWeVbxxeAZNlbf1obxYjEJCoutIP2jQ; oops=vLINH8qXPw_1k9jR3NkjRa3B2Z8AAAAAQQoAAGcxw4QsmAgmFDYEWg7Wzvidj-xnMpwybqGpWeVbxxeAZNlbf1obxYjEJCoutIP2jQ; userId=125419621; cssVersion=01b6e343; utm_source=; au_trace_key_net=default; openh5_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; _lxsdk_s=1712a2e1206-e51-e3c-aa6%7C%7C89; terminal=i; w_utmz="utm_campaign=(direct)&utm_source=5433&utm_medium=(none)&utm_content=(none)&utm_term=(none)"; w_latlng=39911854,116510434; w_actual_lat=39911854; w_actual_lng=116510434; w_token=vLINH8qXPw_1k9jR3NkjRa3B2Z8AAAAAQQoAAGcxw4QsmAgmFDYEWg7Wzvidj-xnMpwybqGpWeVbxxeAZNlbf1obxYjEJCoutIP2jQ; openh5_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; igateApp=%3C%25%3D%20htmlWebpackPlugin.options.iGateAppKey%20%25%3E; logan_session_token=wnj6vqmz6n0ptcfbw4n8; logan_custom_report=`,
		"runc":`IJSESSIONID=krnrxojhyg5u1mla3q2hfakhj; _lxsdk_cuid=170f768f6b1c8-0d77ee74f3cebd-6a177a22-448e0-170f768f6b15b; _lxsdk=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; webp=1; ci3=1; uuid=74bba31d-8502-4fce-901d-243895502334; _hc.v=ffd573f4-9547-a837-1ec3-752c000f1fa6.1584698829; JSESSIONID=14ux46lbfirmx28s816b045d3; c_6NCia=1; ; __mta=250003129.1584699068850.1584699068850.1584699068850.1; w_addr=%E6%9C%9D%E9%98%B3%E5%8C%BA%E7%94%98%E9%9C%B2%E5%9B%AD%E5%8D%97%E9%87%8C%E4%BA%8C%E5%8C%BA(102%E5%9B%BD%E9%81%93%E5%8D%97); latlng=39.910697,116.504452,1585532440984; cityname=%E5%8C%97%E4%BA%AC; __utma=74597006.1422517486.1584698817.1584698817.1585532434.2; __utmc=74597006; __utmz=74597006.1585532434.2.2.utmcsr=sm.cn|utmccn=sm.cn|utmcmd=organic|utmctr=%E7%BE%8E%E5%9B%A2%E7%BD%91%E9%A1%B5%E7%89%88|utmcct=100001; i_extend=C_b1Gimthomepagecategory11H__a; ci=1; meishi_ci=1; cityid=1; p_token=IplXXLaGAatRU7wP5Z9w0etMSdUAAAAAQQoAAJtRnplGfuryswMbk4X1ow9Ihk0iz5gLak89Honu6L9nmcoKF1wsMD0Y70TmpnqCsw; utm_source=0; wx_channel_id=0; wm_order_channel=default; _lx_utm=utm_source%3Dsm.cn%26utm_medium%3Dorganic%26utm_term%3D%25E7%25BE%258E%25E5%259B%25A2%25E5%25A4%2596%25E5%258D%2596; w_visitid=8d3a585d-8d59-489d-bd22-46bc32204ebf; channelType={%22default%22:%220%22}; igateApp=%3C%25%3D%20htmlWebpackPlugin.options.iGateAppKey%20%25%3E; logan_session_token=9vkoo5brc48nd0xrmg5l; logan_custom_report=; w_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; w_token=Cy2rDAoMjsT-kvGWVIWiqvywIPoAAAAAQQoAAKno4ULuJdOzT6qY62tmq7KaUvqIt5vpsQkysPYG0M-nHILmXQvsK4AaKA_jJKhx9w; service-off=0; terminal=i; w_utmz="utm_campaign=(direct)&utm_source=5433&utm_medium=(none)&utm_content=(none)&utm_term=(none)"; w_latlng=0,0; w_actual_lat=39911267; w_actual_lng=116509875; openh5_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; iuuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; token=7PmoAqlb-R4TEhNOD1jPIksIzyEAAAAAQQoAAILq8R363KrPrU2Hm4NVXqj-8QVoWs7R0pAPxXb5e8KNFLq6yKCCCVh-rAwnX1ODjQ; mt_c_token=7PmoAqlb-R4TEhNOD1jPIksIzyEAAAAAQQoAAILq8R363KrPrU2Hm4NVXqj-8QVoWs7R0pAPxXb5e8KNFLq6yKCCCVh-rAwnX1ODjQ; oops=7PmoAqlb-R4TEhNOD1jPIksIzyEAAAAAQQoAAILq8R363KrPrU2Hm4NVXqj-8QVoWs7R0pAPxXb5e8KNFLq6yKCCCVh-rAwnX1ODjQ; userId=1436988874; cssVersion=2a0d0d4c; utm_source=; au_trace_key_net=default; openh5_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; _lxsdk_s=1712a2e1206-e51-e3c-aa6%7C%7C132`,
		"tt":`IJSESSIONID=krnrxojhyg5u1mla3q2hfakhj; _lxsdk_cuid=170f768f6b1c8-0d77ee74f3cebd-6a177a22-448e0-170f768f6b15b; _lxsdk=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; webp=1; ci3=1; uuid=74bba31d-8502-4fce-901d-243895502334; _hc.v=ffd573f4-9547-a837-1ec3-752c000f1fa6.1584698829; JSESSIONID=14ux46lbfirmx28s816b045d3; c_6NCia=1; ; __mta=250003129.1584699068850.1584699068850.1584699068850.1; w_addr=%E6%9C%9D%E9%98%B3%E5%8C%BA%E7%94%98%E9%9C%B2%E5%9B%AD%E5%8D%97%E9%87%8C%E4%BA%8C%E5%8C%BA(102%E5%9B%BD%E9%81%93%E5%8D%97); latlng=39.910697,116.504452,1585532440984; cityname=%E5%8C%97%E4%BA%AC; __utma=74597006.1422517486.1584698817.1584698817.1585532434.2; __utmc=74597006; __utmz=74597006.1585532434.2.2.utmcsr=sm.cn|utmccn=sm.cn|utmcmd=organic|utmctr=%E7%BE%8E%E5%9B%A2%E7%BD%91%E9%A1%B5%E7%89%88|utmcct=100001; i_extend=C_b1Gimthomepagecategory11H__a; ci=1; meishi_ci=1; cityid=1; p_token=IplXXLaGAatRU7wP5Z9w0etMSdUAAAAAQQoAAJtRnplGfuryswMbk4X1ow9Ihk0iz5gLak89Honu6L9nmcoKF1wsMD0Y70TmpnqCsw; utm_source=0; wx_channel_id=0; wm_order_channel=default; _lx_utm=utm_source%3Dsm.cn%26utm_medium%3Dorganic%26utm_term%3D%25E7%25BE%258E%25E5%259B%25A2%25E5%25A4%2596%25E5%258D%2596; w_visitid=b7d89676-76df-488e-a379-711b8aeacd4b; channelType={%22default%22:%220%22}; igateApp=%3C%25%3D%20htmlWebpackPlugin.options.iGateAppKey%20%25%3E; logan_session_token=arsldh95azkpki684uaz; logan_custom_report=; w_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; w_token=7PmoAqlb-R4TEhNOD1jPIksIzyEAAAAAQQoAAILq8R363KrPrU2Hm4NVXqj-8QVoWs7R0pAPxXb5e8KNFLq6yKCCCVh-rAwnX1ODjQ; service-off=0; terminal=i; w_utmz="utm_campaign=(direct)&utm_source=5433&utm_medium=(none)&utm_content=(none)&utm_term=(none)"; w_latlng=0,0; w_actual_lat=39913085; w_actual_lng=116516429; openh5_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; iuuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; token=KSpuCOUqJGpAiY4Kjl-mdW0RVwoAAAAAQQoAACqRpCAou4IjM52N1jvxIAipP6q0wT-dof5OhbCqq7diqHdn5qWUqrIUN5T_d7XzPQ; mt_c_token=KSpuCOUqJGpAiY4Kjl-mdW0RVwoAAAAAQQoAACqRpCAou4IjM52N1jvxIAipP6q0wT-dof5OhbCqq7diqHdn5qWUqrIUN5T_d7XzPQ; oops=KSpuCOUqJGpAiY4Kjl-mdW0RVwoAAAAAQQoAACqRpCAou4IjM52N1jvxIAipP6q0wT-dof5OhbCqq7diqHdn5qWUqrIUN5T_d7XzPQ; userId=1397881246; cssVersion=2a0d0d4c; utm_source=; au_trace_key_net=default; openh5_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC; _lxsdk_s=1712ae2d106-e06-9c9-322%7C%7C29`,
		"sijia":`iuuid=3C0A83B713E2C0868950C0EEB3F16C86A2A5E8856410ADE9391B09EA1784DA5F; token=JCewisJwg4OoVKF_6ak9tLO8nEYAAAAARQoAACgyK6dQnm_keigWhQyQZAOhIh37xmsn0loV7kwt5M2HPMWsXTrl7Qvx2ybw3NT2ag; userid=131465837; openid=oOpUI0Q_emgy5X8IpksWMo-K9D-Y; igateApp=%3C%25%3D%20htmlWebpackPlugin.options.iGateAppKey%20%25%3E; logan_custom_report=; _lxsdk_cuid=1712a444192c8-021bae177cde23-3e1a2c7b-55188-1712a444193c8; _lxsdk=3C0A83B713E2C0868950C0EEB3F16C86A2A5E8856410ADE9391B09EA1784DA5F; terminal=i; w_utmz="utm_campaign=(direct)&utm_source=5000&utm_medium=(none)&utm_content=(none)&utm_term=(none)"; w_latlng=39911992,116509868; w_actual_lat=39911992; w_actual_lng=116509868; w_token=JCewisJwg4OoVKF_6ak9tLO8nEYAAAAARQoAACgyK6dQnm_keigWhQyQZAOhIh37xmsn0loV7kwt5M2HPMWsXTrl7Qvx2ybw3NT2ag; w_uuid=3C0A83B713E2C0868950C0EEB3F16C86A2A5E8856410ADE9391B09EA1784DA5F; logan_session_token=cbzwe4ngpo6rawz5bxhv; _lxsdk_s=1712afcb0b3-a86-e81-a42%7C%7CNaN`,

	}

	url = "https://i.waimai.meituan.com/ajax/v6/poi/qualification"

	header := map[string]string{}
	header["Origin"]=`https://i.waimai.meituan.com`
	header["x-requested-with"]=`XMLHttpRequest`



	header["Referer"] = "https://i.waimai.meituan.com/c/foods_safe_doc/index.html?wm_poi_id=1059264691928254&wm_latitude=39911267&wm_longitude=116509875&wm_actual_latitude=39911267&wm_actual_longitude=116509875&wm_ctype=openapi&wm_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC"
	header["Cookie"] = cookieArr["sijia"]
	header["User-Agent"] = "Mozilla/5.0 (Linux; U; Android 9; zh-CN; SEA-AL00 Build/HUAWEISEA-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.9.2.1072 Mobile Safari/537.36"
	header["content-type"] = "application/x-www-form-urlencoded"
	header = common.MergreHeader(header, common.CommonHeader)


	data = `wm_poi_id=1059264691928254&wm_latitude=39911267&wm_longitude=116509875&wm_actual_latitude=39911267&wm_actual_longitude=116509875&wm_ctype=openapi&wm_uuid=5737EF407F90A002AE885E541B62D03F943F2FC4EC7B5C511C5560B5E6574FCC`
	str, err := fetcher.MeiTuanPost(url, header, data)

	if err != nil {
		panic(err)
	}
	fmt.Printf("%s\n", str)
	var (
		res meituanMeishiH5.ResLicence
	)
	err = json.Unmarshal(str, &res)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%+v", res)

}
